<?php

namespace App\Http\Controllers;

use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Http\Request;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;

class Controller extends BaseController
{
    use  DispatchesJobs, ValidatesRequests;
    public function __construct(Request $request)
    {

        $loginuser = $request->session()->get('loginuser');

        if(empty($loginuser) && $request->path() != '/admin/login') {

            header('Location:/admin/login');
        }
    }
}
